package com.cloud.wms.ui.main.entity;

import com.cloud.wms.R;

import java.util.List;

/**
 * @Author:Chen
 * @Date: 2021-01-19 10:04
 * @Description:
 */
public class ModelEntity {
    private long moduleID;
    private String moduleCode;
    private String moduleName;
    private long parentModuleId;
    private String url;
    private String taskCode;
    private String appKey;
    private int sortNum;
    private List<ModelEntity> childModel;

    public int getSortNum() {
        return sortNum;
    }

    public void setSortNum(int sortNum) {
        this.sortNum = sortNum;
    }

    public long getModuleID() {
        return moduleID;
    }

    public void setModuleID(long moduleID) {
        this.moduleID = moduleID;
    }

    public String getModuleCode() {
        return moduleCode == null ? "" : moduleCode;
    }

    public void setModuleCode(String moduleCode) {
        this.moduleCode = moduleCode;
    }

    public String getModuleName() {
        return moduleName == null ? "" : moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    public long getParentModuleId() {
        return parentModuleId;
    }

    public void setParentModuleId(long parentModuleId) {
        this.parentModuleId = parentModuleId;
    }

    public String getUrl() {
        return url == null ? "" : url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getTaskCode() {
        return taskCode == null ? "" : taskCode;
    }

    public void setTaskCode(String taskCode) {
        this.taskCode = taskCode;
    }

    public String getAppKey() {
        return appKey == null ? "" : appKey;
    }

    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }

    public List<ModelEntity> getChildModel() {
        return childModel;
    }

    public void setChildModel(List<ModelEntity> childModel) {
        this.childModel = childModel;
    }

    public int getIcon() {
        int res = -1;
        switch (getUrl()) {
            case "in.register.InOrderActivity":
                res = R.mipmap.icon_in_register;
                break;
            case "in.inventory.InOrderActivity":
                res = R.mipmap.icon_in_inventory;
                break;
            case "in.shelf.InOrderActivity":
                res = R.mipmap.icon_in_shelf;
                break;
            case "print.activity.SelectBoxActivity":
                res = R.mipmap.icon_mark_print;
                break;
            case "inside.container.ReleaseActivity":
                res = R.mipmap.icon_box_release;
                break;
            case "inside.replenish.ApplyStartActivity":
                res = R.mipmap.icon_replenish_apply;
                break;
            case "inside.revert.RevertCommodityActivity":
                res = R.mipmap.icon_inside_revert;
                break;
            case "data.activity.UploadImgActivity":
                res = R.mipmap.icon_up_img;
                break;
            case "data.activity.CheckInventoryActivity":
                res = R.mipmap.icon_data_storage;
                break;
            case "sort.car.CarBatchActivity":
                res = R.mipmap.icon_car_sort;
                break;
            case "sort.detach.DetachStartActivity":
                res = R.mipmap.icon_sort_detach;
                break;
            case "sort.order.OrderBatchActivity":
                res = R.mipmap.icon_order_sort;
                break;
            case "sort.sku.SkuBatchActivity":
                res = R.mipmap.icon_sku_sort;
                break;
            case "sort.group.GroupBatchActivity":
                res = R.mipmap.icon_group_sort;
                break;
            case "group.collect.GroupBatchActivity":
                res = R.mipmap.icon_group_collect;
                break;
            case "group.obtain.GroupBatchActivity":
                res = R.mipmap.icon_group_obtain;
                break;
            case "returned.register.ReturnExpressDeliveryActivity":
                res = R.mipmap.icon_returned_register;
                break;
            case "returned.relay.RelayBoxActivity":
                res = R.mipmap.icon_returned_relay;
                break;
            case "returned.inventory.ExpressActivity":
                res = R.mipmap.icon_returned_inventory;
                break;
            case "returned.inquire.FaceSheetStartActivity":
                res = R.mipmap.icon_returned_sheet_query;
                break;
            case "inside.transfer.TransferDownStartActivity":
                res = R.mipmap.icon_transfer_down;
                break;
            case "inside.transfer.TransferUpStartActivity":
                res = R.mipmap.icon_transfer_up;
                break;
        }
        if (res < 0) {
            res = R.mipmap.icon_in_register;
        }
        return res;
    }
}
